<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
  <th:block th:include="include :: header('新增商品信息')" />
  <th:block th:include="include :: bootstrap-fileinput-css"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
  <form class="form-horizontal m" id="form-shangpinxinxiTest-xiadan">
    <div class="form-group">
      <label class="col-sm-3 control-label">商品编号：</label>
      <div class="col-sm-8">
        <input name="shangpinId" class="form-control" type="text">
      </div>
    </div>
    <div class="form-group">
      <label class="col-sm-3 control-label">商品名称：</label>
      <div class="col-sm-8">
        <input name="shangpinName" class="form-control" type="text">
      </div>
    </div>

    <div class="form-group">
      <label class="col-sm-3 control-label">商品规格：</label>
      <div class="col-sm-8">
        <input name="shangpinGuige" class="form-control" type="text">
      </div>
    </div>
    <div class="form-group">
      <label class="col-sm-3 control-label">商品类别：</label>
      <div class="col-sm-8">
        <input name="shangpinLeibie" class="form-control" type="text">
      </div>
    </div>
    <div class="form-group">
      <label class="col-sm-3 control-label">商品批发价：</label>
      <div class="col-sm-8">
        <input name="shangpinPifajia" class="form-control" type="text">
      </div>
    </div>
    <div class="form-group">
      <label class="col-sm-3 control-label">商品零售价：</label>
      <div class="col-sm-8">
        <input name="shangpinLingshoujia" class="form-control" type="text">
      </div>
    </div>
    <div class="form-group">
      <label class="col-sm-3 control-label">总部底价：</label>
      <div class="col-sm-8">
        <input name="shangpinDijia" class="form-control" type="text">
      </div>
    </div>
    <div class="form-group">
      <label class="col-sm-3 control-label">备注：</label>
      <div class="col-sm-8">
        <input name="beizhu" class="form-control" type="text">
      </div>
    </div>
    <div class="form-group">
      <label class="col-sm-3 control-label">图片：</label>
      <div class="col-sm-8">
        <input type="hidden" name="shangpinTupian">
        <div class="file-loading">
          <input class="form-control file-upload" id="shangpinTupian" name="file" type="file">
        </div>
      </div>
    </div>
  </form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: bootstrap-fileinput-js"/>
<script th:inline="javascript">
  var prefix = ctx + "shangpinxinxi/shangpinxinxiTest"
  $("#form-shangpinxinxiTest-add").validate({
    focusCleanup: true
  });

  function submitHandler() {
    if ($.validate.form()) {
      $.operate.save(prefix + "/add", $('#form-shangpinxinxiTest-add').serialize());
    }
  }

  $(".file-upload").fileinput({
    uploadUrl: ctx + 'common/upload',
    maxFileCount: 1,
    autoReplace: true
  }).on('fileuploaded', function (event, data, previewId, index) {
    $("input[name='" + event.currentTarget.id + "']").val(data.response.url)
  }).on('fileremoved', function (event, id, index) {
    $("input[name='" + event.currentTarget.id + "']").val('')
  })


</script>
</body>
</html>